// Pelc 2011 IO

// Load original dataset
clear
use "P2011 IO Rep Data.dta"

// REPLICATION
summarize
display c(k)
mdesc 
tabmiss
codebook reporter
gen eloggdpcap = exp(loggdpcap)
summarize

// Table 3
// De jure depth
reg depth2 logGDPconst logfullimports logfullexports accessionperiod loggdpcap MFNpre polity3 chinadum howLATE , cluster(reporter)
mdesc depth2 logGDPconst logfullimports logfullexports accessionperiod loggdpcap MFNpre polity3 chinadum howLATE
codebook reporter if e(sample)

// De facto depth
reg depth3 logGDPconst logfullimports logfullexports accessionperiod loggdpcap MFNpre polity3 chinadum howLATE , cluster(reporter)
mdesc depth3 logGDPconst logfullimports logfullexports accessionperiod loggdpcap MFNpre polity3 chinadum howLATE
codebook reporter if e(sample)

// IMPUTATION
clear
use "P2011 IO Imp Data.dta"
summarize

mi import flong, m(imp) id(reporter case) imp(MFNpre-Xexp)

// Table 3
// De jure depth
mi estimate, post: reg depth2 logGDPconst logfullimports logfullexports accessionperiod loggdpcap MFNpre polity3 chinadum howLATE , cluster(reporter)

// De facto depth
mi estimate, post:reg depth3 logGDPconst logfullimports logfullexports accessionperiod loggdpcap MFNpre polity3 chinadum howLATE , cluster(reporter)


